var mongodb = require('mongodb');

function loadDB(callback, poolSize, host, port, name) {
    poolSize = poolSize || 2;

    var mongo_url =  "mongodb://"+host+":"+port+"/"+name;
    log.info('mongo url '+mongo_url);
    var mongo_client = mongodb.MongoClient;

    mongo_client.connect(mongo_url, function(err, db) {
        if( err ) {
            console.log(err);
            process.exit(-1);
        }
        callback && callback(db);
    });
}

exports.loadDB = loadDB;
